package net.javastone.toolkit.core.utils;

import lombok.experimental.UtilityClass;

import java.util.Optional;

/**
 * Created by sdliang on 2019/10/11.
 */
@UtilityClass
public class Args {

  /**
   * 获取参数
   *
   * @param args 参数列表
   * @param idx  获取下标
   * @return
   */
  public static Optional<String> getParameter(String[] args, int idx) {
    String arg = null;
    if (args.length > idx) {
      arg = args[idx];
    }
    return Optional.ofNullable(arg);

  }

}
